<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>innerHtml和innerText的区别</title>
</head>
<body>
<p id="my-content"></p>
<script>
    let element = document.getElementById("my-content");
    element.innerText='<a href="https://baidu.com">点击有惊喜</a>'
</script>
</body>
</html>